﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Production
{
    public class InventoryLedger : BusinessObject
    {
        public InventoryLedger()
        {
            AddRule(new ValidateRequired("RefID"));

            AddRule(new ValidateRequired("RefNo"));
            AddRule(new ValidateLength("RefNo", 0, 20));

            AddRule(new ValidateRequired("StockID"));

            AddRule(new ValidateRequired("RestaurantID"));
        }

        public InventoryLedger(string inventoryLedgerId, string refId, string refDetailId, int refType, string refNo, DateTime refDate, DateTime postedDate,
                                    string stockId, string inventoryItemId, string restaurantMenuId, string unit, decimal unitPrice,
                                    decimal inwardQuantity, decimal outwardQuantity, decimal inwardAmount, decimal outwardAmount,
                                    string journalMemo, string description, int outwardPurpose, string restaurantId)
            : this()
        {
            InventoryLedgerID = inventoryLedgerId;
            RefID = refId;
            RefDetailID = refDetailId;
            RefType = refType;
            RefNo = refNo;
            RefDate = refDate;
            PostedDate = postedDate;
            StockID = stockId;
            InventoryItemID = inventoryItemId;
            RestaurantMenuID = restaurantMenuId;
            Unit = unit;
            UnitPrice = unitPrice;
            InwardQuantity = inwardQuantity;
            OutwardQuantity = outwardQuantity;
            OutwardAmount = outwardAmount;
            InwardAmount = inwardAmount;
            JournalMemo = journalMemo;
            Description = description;
            OutwardPurpose = outwardPurpose;
            RestaurantID = restaurantId;
        }

        public string InventoryLedgerID { get; set; }

        public string RefID { get; set; }

        public string RefDetailID { get; set; }

        public int RefType { get; set; }

        public string RefNo { get; set; }

        public DateTime RefDate { get; set; }

        public DateTime PostedDate { get; set; }

        public string StockID { get; set; }

        public string InventoryItemID { get; set; }

        public string RestaurantMenuID { get; set; }

        public string Unit { get; set; }

        public decimal UnitPrice { get; set; }

        public decimal InwardQuantity { get; set; }

        public decimal OutwardQuantity { get; set; }

        public decimal InwardAmount { get; set; }

        public decimal OutwardAmount { get; set; }

        public string JournalMemo { get; set; }

        public string Description { get; set; }

        public int OutwardPurpose { get; set; }

        public string RestaurantID { get; set; }
    }
}
